<!-- <template>
  <div class="container">
    <div class="app-container">
      <el-tree
        :data="depts"
        :props="props"
        :expand-on-click-node="false"
        icon-class="el-icon-office-building"
        default-expand-all
        highlight-current
      />
    </div>
  </div>
</template>

<script>
import { getDepartmentList } from '@/api/homework/zhuzhijiagou'
import { transListToTree } from '@/utils'
export default {
  data() {
    return {
      // 组织架构列表数据
      depts: [],
      // 读取数据的字段名
      props: { label: 'name' }
    }
  },
  created() {
    // 获取组织架构列表数据
    this.getDepartments()
  },
  methods: {
    // 获取组织架构列表数据
    async getDepartments() {
      // 调用组织架构列表接口
      const res = await getDepartmentList()
      console.log(res)
      this.depts = transListToTreeData(res.data, 0)
    }
  }
}
</script>
 -->
